package com.micro.order.controller;

import com.alibaba.nacos.api.model.v2.Result;
import com.micro.model.Order;
import com.micro.order.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api")
public class OrderController {

    @Autowired
    private IOrderService orderService;

    @GetMapping(value = "/orders/{id}")
    public Result<Order> getOrder(@PathVariable("id") Long id) {
        return Result.success(orderService.getOrder(id));
    }


}
